From e5dc435210d097e04cbb8203491dd4d0abecfee1 Mon Sep 17 00:00:00 2001 From: "maf46@burn.cl.cam.ac.uk" Date: Fri, 25 Feb 2005 13:37:57 +0000 Subject: [PATCH] bitkeeper revision 1.1236.3.1 (421f2a35S4BT09otLbDXG1U-Qs355g) Added some defensive code to notice when we're run out of map cache entries. Signed-off-by: michael.fetterman@cl.cam.ac.uk --- xen/arch/x86/x86_32/domain_page.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/arch/x86/x86_32/domain_page.c b/xen/arch/x86/x86_32/domain_page.c index 5666513719..e3aa720c78 100644 --- a/xen/arch/x86/x86_32/domain_page.c +++ b/xen/arch/x86/x86_32/domain_page.c @@ -44,6 +44,9 @@ void *map_domain_mem(unsigned long pa) unsigned long va; unsigned int idx, cpu = smp_processor_id(); unsigned long *cache = mapcache; +#ifndef NDEBUG + unsigned flush_count = 0; +#endif ASSERT(!in_irq()); perfc_incrc(map_domain_mem_count); @@ -66,6 +69,13 @@ void *map_domain_mem(unsigned long pa) perfc_incrc(domain_page_tlb_flush); local_flush_tlb(); shadow_epoch[cpu] = ++epoch; +#ifndef NDEBUG + if ( unlikely(flush_count++) ) + { + // we've run out of map cache entries... + BUG(); + } +#endif } } while ( cache[idx] != 0 ); -- 2.30.2